﻿module utils.fileWrapper.Interfaces; 

interface InputWrapper{
	abstract void readExact(void* buffer, uint size);
	abstract uint read(ubyte[] buffer);
	abstract void read(out byte x);
	abstract void read(out ubyte x);
	abstract void read(out short x);
	abstract void read(out ushort x);
	abstract void read(out int x);
	abstract void read(out uint x);
	abstract void read(out long x);
	abstract void read(out ulong x);
	abstract void read(out float x);
	abstract void read(out double x);
	abstract void read(out real x);
	abstract void read(out ifloat x);
	abstract void read(out idouble x);
	abstract void read(out ireal x);
	abstract void read(out cfloat x);
	abstract void read(out cdouble x);
	abstract void read(out creal x);
	abstract void read(out char x);
	abstract void read(out wchar x);
	abstract void read(out dchar x);
	abstract void read(out char[] s);
	abstract void read(out wchar[] s);
	abstract char[] readLine();
	abstract char[] readLine(char[] result);
	abstract wchar[] readLineW();
	abstract wchar[] readLineW(wchar[] result);
	abstract int opApply(int delegate(inout char[] line) dg);
	abstract int opApply(int delegate(inout ulong n, inout char[] line) dg);
	abstract int opApply(int delegate(inout wchar[] line) dg);
	abstract int opApply(int delegate(inout ulong n, inout wchar[] line) dg);
	abstract char[] readString(uint length);
	abstract wchar[] readStringW(uint length);
	abstract char getc();
	abstract wchar getcw();
	abstract char ungetc(char c);
	abstract wchar ungetcw(wchar c);
	abstract int vreadf(TypeInfo[] arguments, void* args);
	
	/*  TODO if necessery

	abstract int readf(...); 

	*/
	
	abstract uint available();
	abstract bool eof();
	abstract bool isOpen();
}

interface OutputWrapper{
	abstract void writeExact(void* buffer, uint size);
	abstract uint write(ubyte[] buffer);
	abstract void write(byte x);
	abstract void write(ubyte x);
	abstract void write(short x);
	abstract void write(ushort x);
	abstract void write(int x);
	abstract void write(uint x);
	abstract void write(long x);
	abstract void write(ulong x);
	abstract void write(float x);
	abstract void write(double x);
	abstract void write(real x);
	abstract void write(ifloat x);
	abstract void write(idouble x);
	abstract void write(ireal x);
	abstract void write(cfloat x);
	abstract void write(cdouble x);
	abstract void write(creal x);
	abstract void write(char x);
	abstract void write(wchar x);
	abstract void write(dchar x);
	abstract void write(char[] s);
	abstract void write(wchar[] s);
	abstract void writeLine(char[] s);
	abstract void writeLineW(wchar[] s);
	abstract void writeString(char[] s);
	abstract void writeStringW(wchar[] s);

	abstract void flush();
	abstract void close();
	//abstract bool isOpen();

/*

	TODO if necessery
	abstract uint vprintf(char[] format, void* args); 
	abstract uint printf(char[] format,...);
	abstract OutputStream writef(...);
	abstract OutputStream writefln(...);
	abstract OutputStream writefx(TypeInfo[] arguments, void* argptr, int newline = cast(int)false);

	*/
}